package com.designPattern.simpleFactory.creator;

import com.designPattern.simpleFactory.factory.SimplePizzaFactory;
import com.designPattern.simpleFactory.product.Pizza;

/**
 * 披萨商店，生产销售披萨
 */
public class PizzaStore {
	
	SimplePizzaFactory factory;
	
	public PizzaStore(SimplePizzaFactory factory){
		this.factory = factory;
	}
	
	/**
	 * 订购披萨方法
	 * @param type
	 * @return Pizza
	 */
	public Pizza orderPizza(String type){
		Pizza pizza = null;
		pizza = factory.createPizza(type);
		
		pizza.prepare();
		pizza.bake();
		pizza.cut();
		pizza.box();
		
		return pizza;
	}
	
	//其他方法
	
}
